package com.guochenglang.www.dao;

import com.guochenglang.www.pojo.Dialog;

import java.sql.SQLException;
import java.util.ArrayList;

/**
 * @author GuoChenglang
 */
public interface DialogDao {
    /**
     * 获取聊天信息
     *
     * @param conditions 获取条件
     * @return 聊天信息列表
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     * @throws InstantiationException 实现异常
     */
    ArrayList<Dialog> dialogSelect(Dialog conditions) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;

    /**
     * 添加聊天信息
     *
     * @param comfort 添加信息
     * @return 添加主键
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     */
    int insertDialog(Dialog comfort) throws SQLException, InterruptedException, IllegalAccessException;

    /**
     * 删除聊天信息
     *
     * @param conditions 删除条件
     * @return 删除行数
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     */
    int deleteDialog(Dialog conditions) throws SQLException, InterruptedException, IllegalAccessException;

    /**
     * 更新聊天记录
     *
     * @param set        更新的数据
     * @param conditions 更新条件
     * @return 更新行数
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     */
    int updateDialog(Dialog set, Dialog conditions) throws SQLException, InterruptedException, IllegalAccessException;
}
